package com.itHsuSE.encap;

public class Amount {
    private String name;
    private double salary;
    private String password;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        if(name.length()>=2&&name.length()<=4){
            this.name = name;
        }else {
            System.out.println("长度不符合");
            this.name="无名氏";
        }
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        if(salary>20){
            this.salary = salary;
        }else {
            System.out.println("余额太少");
            this.salary=20;
        }
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        if(password.length()==6){
            this.password = password;
        }else {
            System.out.println("密码不符合");
            this.password="123456";
        }

    }
}
